Description:
Delphi
allows you to replace the type check (is) and type cast operators with the single as
operator. This makes the code clearer and improves performance.
Incorrect:
var str:String;
...
if obj is String then
begin
str := String(obj);
result := str.Length;
end;
Correct:
var str:String;
...
str := obj as String;
if str <> nil then
result := str.Length;
end;